﻿using YiShop.Framework.Data;

namespace YiShop.Framework.EventBus
{
    // 领域层（Domain Layer）
    public interface IDomainEventDispatcher
    {
        /// <summary>
        /// 分发聚合根中积累的领域事件
        /// </summary>
        /// <param name="aggregate">触发事件的聚合根实例</param>
        Task DispatchEventsAsync(AggregateRoot aggregate);

        /// <summary>
        /// 分发单个领域事件（可选扩展）
        /// </summary>
        Task DispatchEventAsync<TEvent>(TEvent domainEvent) where TEvent : IDomainEvent;
    }
}